<?php exit("breakcms"); ?>
{include file="public/not_index_header.php"}
{if $_POST['action']=='from'}
<div class="showinfo">
    这里显示 分类总描述 和 当前数据集的描述
</div>

<form action="" method="post" id="brk_form" enctype="application/x-www-form-urlencoded" target="">

    <div class="showtable">
        <table border="0" cellpadding="0" cellspacing="1" width="100%" class="tableborder">
            <tr  class="textcenter  tr1">
                <td width="10%">ID</td>
                <td width="20%">层级</td>
                <td width="15%">类名</td>
                <td width="10%">排序</td>
                <td width="30%">操作</td>
            </tr>
            {foreach from="$CATEGORY_ROOT" first}
            <tr  onmouseover="$reClassName=this.className;this.className='textcenter table_tr_bgin'" onmouseout="this.className=$reClassName"  class="textcenter  {cycle values="table_tr_bg1,table_tr_bg2"}">
                 <td>{$item['cid']}</td>
                             <td class="textleft">&nbsp;&nbsp;{$item['clayerstr']}{$item['clayer']}</td>
                             <td class="textleft">&nbsp;&nbsp;<input name="cat_name[{$item['cid']}]" class="input_text_2"  value="{$item['cname']}"/></td>
                             <td><input name="cat_sort[{$item['cid']}]" class="input_text_1"  value="{$item['csort']}"/></td>
                             <td><a href="?{$item['cid']|bgpre:'a-'.$COLLECTION_ENAME.'/catac-add/cid-'.this}">添加</a>&nbsp;&nbsp;<a href="?{$item['cid']|bgpre:'a-'.$COLLECTION_ENAME.'/catac-edit/cid-'.this}">编辑</a>&nbsp;&nbsp;{if !$first}<a href="?{$item['cid']|bgpre:'a-'.$COLLECTION_ENAME.'/catac-move/cid-'.this}">移动</a>&nbsp;&nbsp;<a href="?{$item['cid']|bgpre:'a-'.$COLLECTION_ENAME.'/catac-del/cid-'.this}" onclick="if(!confirm('你确定要?\n\n删除后\n他的所有子类也将会被删除')){return false}">删除</a>&nbsp;&nbsp;{/if}<a href="?{$item['cid']|bgpre:'a-'.$COLLECTION_ENAME.'/catac-clear/cid-'.this}" onclick="if(!confirm('你确定要?\n\n清空他的子类?')){return false}">清空子类</a></td>
                         </tr>
                         {/foreach}

            </table>
        </div>


        <div class="showbutton_right">
            <input value="保存" type="submit" class="button"/>&nbsp;&nbsp;&nbsp;&nbsp;<input value="重置"   type="reset" class="button"/><input value="update" name="postaction" type="hidden" />
        </div>
    </form>
    {include file="public/not_index_footer.php"}

    {elseif $_POST['action']=='add'}

    <div class="showinfo">
        添加分类
    </div>
    <form action="" method="post" id="channel_add_from">
        <div class="showbutton_left">
            <input value="保存" type="submit" class="button"/>&nbsp;&nbsp;&nbsp;&nbsp;<input value="重置"   type="reset" class="button"/>
        </div>
        <div class="showtable" align="left">
            <table border="0" cellpadding="0" cellspacing="1" width="100%" class="tableborder">
                <tr class="tr1">
                    <td width="26%" align="right">分类名&nbsp;&nbsp;</td>
                    <td width="74%" align="left">&nbsp;&nbsp;{foreach from=$THIPATH}{$item['cname']}&gt;{/foreach}<br>&nbsp;&nbsp;<input type="text" name="cat[name]" class="input_text_default" /></td>
                </tr>
                <tr class="tr1">
                    <td align="right">描述&nbsp;&nbsp;</td>
                    <td align="left">&nbsp;&nbsp;<textarea name="cat[note]" class="textarea_1"   cols="30" rows="5"></textarea></td>
                </tr>
                <tr class="tr1">
                    <td align="right">链接地址&nbsp;&nbsp;</td>
                    <td align="left">&nbsp;&nbsp;<input type="text" name="cat[url]" id="url" class="input_text_default"/><br />完整的URL,形如 "http://x.x.x".如果设置了此项,点击该频道直接跳到目标URL.可以忽略</td>
                </tr>
                <tr class="tr1">
                    <td align="right">打开方式&nbsp;&nbsp;</td>
                    <td align="left">&nbsp;&nbsp;<select class="select_default" name="cat[urlTarget]" >
                            <option value="0">本页</option>
                            <option value="1" selected="selected">新页</option>
                        </select><br />作用于上面设置的链接地址.可以忽略</td>
                </tr>
                <tr class="tr1">
                    <td align="right">列表模板&nbsp;&nbsp;</td>
                    <td align="left">&nbsp;&nbsp;<input type="text" name="cat[tpl]" id="tpl" class="input_text_default"/><br/>空则继承父类的或者频道的模板设置 父类优先</td>
                </tr>
                <tr class="tr1">
                    <td align="right">内容模板&nbsp;&nbsp;</td>
                    <td align="left">&nbsp;&nbsp;<input type="text" name="cat[viewtpl]" id="viewtpl" class="input_text_default"/><br/>空则继承父类的或者频道的模板设置 父类优先</td>
                </tr>
            </table>
        </div>
        <div class="showbutton_right">
            <input value="保存" type="submit" class="button"/>&nbsp;&nbsp;&nbsp;&nbsp;<input value="重置"   type="reset" class="button"/>
            <input type="hidden" name="postaction" value="add_post" />
        </div>
    </form>


    {include file="public/not_index_footer.php"}

    {elseif $_POST['action']=='edit'}
    <div class="showinfo">
        编辑分类
    </div>
    <form action="" method="post" id="channel_add_from">
        <div class="showbutton_left">
            <input value="保存" type="submit" class="button"/>&nbsp;&nbsp;&nbsp;&nbsp;<input value="重置"   type="reset" class="button"/>
        </div>
        <div class="showtable" align="left">
            <table border="0" cellpadding="0" cellspacing="1" width="100%" class="tableborder">
                <tr class="tr1">
                    <td width="26%" align="right">分类名&nbsp;&nbsp;</td>
                    <td width="74%" align="left">&nbsp;&nbsp;<input type="text" name="cat[name]" value="{$THISCAT['cname']}" class="input_text_default" /></td>
                </tr>
                <tr class="tr1">
                    <td align="right">描述&nbsp;&nbsp;</td>
                    <td align="left">&nbsp;&nbsp;<textarea name="cat[note]" class="textarea_1"   cols="30" rows="5">{$THISCAT['cnote']}</textarea></td>
                </tr>
                <tr class="tr1">
                    <td align="right">链接地址&nbsp;&nbsp;</td>
                    <td align="left">&nbsp;&nbsp;<input type="text" name="cat[url]" value="{$THISCAT['curl']}" id="url" class="input_text_default"/><br />完整的URL,形如 "http://x.x.x".如果设置了此项,点击该频道直接跳到目标URL.可以忽略</td>
                </tr>
                <tr class="tr1">
                    <td align="right">打开方式&nbsp;&nbsp;</td>
                    <td align="left">&nbsp;<select class="select_default" name="cat[urlTarget]" >
                            <option value="0" {if $THISCAT['curlTarget']==0}selected="selected"{/if}>本页</option>
                            <option value="1" {if $THISCAT['curlTarget']==1}selected="selected"{/if}>新页</option>
                        </select><br />作用于上面设置的链接地址.可以忽略</td>
                </tr>
                <tr class="tr1">
                    <td align="right">列表模板&nbsp;&nbsp;</td>
                    <td align="left">&nbsp;&nbsp;<input type="text" name="cat[tpl]"  value="{$THISCAT['ctpl']}"  id="tpl" class="input_text_default"/><br/>空则继承父类的或者频道的模板设置 父类优先</td>
                </tr>
                <tr class="tr1">
                    <td align="right">内容模板&nbsp;&nbsp;</td>
                    <td align="left">&nbsp;&nbsp;<input type="text" name="cat[viewtpl]" value="{$THISCAT['cviewtpl']}"  id="viewtpl" class="input_text_default"/><br/>空则继承父类的或者频道的模板设置 父类优先</td>
                </tr>
            </table>
        </div>
        <div class="showbutton_right">
            <input value="保存" type="submit" class="button"/>&nbsp;&nbsp;&nbsp;&nbsp;<input value="重置"   type="reset" class="button"/>
            <input type="hidden" name="postaction" value="edit_post" />
        </div>
    </form>
    {include file="public/not_index_footer.php"}

    {elseif $_POST['action']=='move'}
    <div class="showinfo">
        移动分类
    </div>
    <form action="" method="post" id="channel_add_from">
        <div class="showbutton_left">
            <input value="保存" type="submit" class="button"/>&nbsp;&nbsp;&nbsp;&nbsp;<input value="重置"   type="reset" class="button"/>
        </div>
        <div class="showtable" align="left">
            <table border="0" cellpadding="0" cellspacing="1" width="100%" class="tableborder">
                <tr class="tr1">
                    <td width="26%" align="right">分类名&nbsp;&nbsp;</td>
                    <td width="74%" align="left">&nbsp;&nbsp;<input type="text" name="cat[name]" value="{$THISCAT['cname']}" class="input_text_default" /></td>
                </tr>
                <tr class="tr1">
                    <td width="26%" align="right">移动节点&nbsp;&nbsp;</td>
                    <td width="74%" align="left">&nbsp;<select class="select_default" name="cat[parent]" >
                            {foreach from=$CATEGORY_ROOT}
                            {if !in_array($item['cid'],$CATNOTinTREE)}
                            <option value="{$item['cid']}" >{$item['clayer']|str_repeat:"──":this}|{$item['cname']}</option>
                            {/if}
                            {/foreach}
                        </select><br />不能移动到自己的直属父类(那样做没有意义),不能移动到自身或自身下面的任何子类.</td>
                </tr>
            </table>
        </div>
        <div class="showbutton_right">
            <input value="保存" type="submit" class="button"/>&nbsp;&nbsp;&nbsp;&nbsp;<input value="重置"   type="reset" class="button"/>
            <input type="hidden" name="postaction" value="move_post" />
        </div>
    </form>
    {include file="public/not_index_footer.php"}


    {elseif $_POST['action']=='message' || $_POST['action']=='error'}
    {include file="public/message.php"}
    {include file="public/not_index_footer.php"}
    {/if}

